﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EasyInvoice.Services
{
    public class ClientsService
    {
        EasyInvoice.SqlCEDAL.IClients dal;

        public ClientsService(EasyInvoice.SqlCEDAL.IClients dal)
        {
            if (dal == null)
            {
                throw new ArgumentNullException("dal");
            }
            this.dal = dal;
        }

        public long Save(Model.Client client)
        {
            return dal.Save(client);
        }

        public Model.Client Delete(Model.Client client)
        {
            return dal.Delete(client);
        }

        public Model.Client Get(long id)
        {
            return dal.GetById(id);
        }

        public IEnumerable<Model.Client> GetAll()
        {
            return dal.GetAll();
        }
    }
}
